Cube Yogi
Cube Yogi
Leader in Zoho Solutions/Consultation

Update Sales Order field by associated Contact's field value

Here is our approach to update Sales Order field by associated Contact's field value

Our Assumption 

1. We assume that you have a Email field in both 'Sales Orders' and 'Contacts' module

Approach 

We've given the steps to update Sales Order field by associated Contact's field value

1. Create workflow to update Sales Order

1.1 Tap on Settings icon

1.2 Tap on "Workflow Rules" under AUTOMATION 

1.3 Tap on "Create Rule"

1.4 Fill all mandatory  fields as mentioned in the image and tap on Next

1.5 Choose "On a record action"

1.6 Choose the following  as mentioned in the image and tap on Next

1.7 Choose 'All Sales Orders' and tap on Next

1.8 Choose "Function" for Instant Actions 

1.9 Tap on "New Function"

1.10 Choose "Write your own"

1.11 Give Function Name as mentioned in the image

1.12 Tap on "Edit Arguments"

1.13 Choose Param value as mentioned in the image and tap on Save

1.14 Copy  and paste the below Code Snippet and tap on Save

1.15 Tap on "Save"

Code Snippet 

Related Community Question

Copy Email From Zoho Contacts to Zoho Sales Order | Link

In Zoho Contacts, I have email addresses already filled in, API name is "Email". I want to transfer this email field when a sales order is created. Name of email field in sales order is "Email"




I tried using this function




soDetails = zoho.crm.getRecordById("Sales_Orders",salesOrderId);

soAccountId = soDetails.get("Account_Name").get("id");

//Setup your fetch

accDetails = zoho.crm.getRecordById("Contacts",contactsId);

//Get Account_Email field from account (api name, setup>api names)

accEmail = accDetails.get("Email");

//Create Map for updating sales order

mp = Map();

//Set your new field update

mp.put("Email",accEmail);

//Update record

resp = zoho.crm.updateRecord("Sales_Orders",salesOrderId,mp);



but I get Failed to execute function

  • Value is empty and 'get' function cannot be applied Line Number:4
Can anyone help me with this code?